﻿using System;
using System.Collections.Generic;
using System.IO;
using Nett;
using SystemModule;

namespace M2Server
{
    public class CommandConfig
    {
        private readonly TomlTable _tableConfig;
        private readonly string _fileName = "commands.toml";

        public CommandConfig()
        {
            if (!File.Exists(_fileName))
            {
                Console.WriteLine("配置文件commands.toml不存在.");
                return;
            }
            var input = new StreamReader(_fileName);
            _tableConfig = Toml.ReadString(input.ReadToEnd());
        }

        /// <summary>
        /// 加载游戏命令
        /// </summary>
        public void LoadGameCommand()
        {
            M2Share.g_GameCommand.Data = GetConfig("Date", M2Share.g_GameCommand.Data);
            M2Share.g_GameCommand.PRVMSG = GetConfig("PrvMsg", M2Share.g_GameCommand.PRVMSG);
            M2Share.g_GameCommand.ALLOWMSG = GetConfig("AllowMsg", M2Share.g_GameCommand.ALLOWMSG);
            M2Share.g_GameCommand.LETSHOUT = GetConfig("LetShout", M2Share.g_GameCommand.LETSHOUT);
            M2Share.g_GameCommand.BANGMMSG = GetConfig("LetTrade", M2Share.g_GameCommand.BANGMMSG);
            M2Share.g_GameCommand.LETGUILD = GetConfig("LetGuild", M2Share.g_GameCommand.LETGUILD);
            M2Share.g_GameCommand.ENDGUILD = GetConfig("EndGuild", M2Share.g_GameCommand.ENDGUILD);
            M2Share.g_GameCommand.BANGUILDCHAT = GetConfig("BanGuildChat", M2Share.g_GameCommand.BANGUILDCHAT);
            M2Share.g_GameCommand.AUTHALLY = GetConfig("AuthAlly", M2Share.g_GameCommand.AUTHALLY);
            M2Share.g_GameCommand.AUTH = GetConfig("Auth", M2Share.g_GameCommand.AUTH);
            M2Share.g_GameCommand.AUTHCANCEL = GetConfig("AuthCancel", M2Share.g_GameCommand.AUTHCANCEL);
            M2Share.g_GameCommand.USERMOVE = GetConfig("UserMove", M2Share.g_GameCommand.USERMOVE);
            M2Share.g_GameCommand.SEARCHING = GetConfig("Searching", M2Share.g_GameCommand.SEARCHING);
            M2Share.g_GameCommand.ALLOWGROUPCALL = GetConfig("AllowGroupCall", M2Share.g_GameCommand.ALLOWGROUPCALL);
            M2Share.g_GameCommand.GROUPRECALLL = GetConfig("GroupCall", M2Share.g_GameCommand.GROUPRECALLL);
            M2Share.g_GameCommand.ALLOWGUILDRECALL = GetConfig("AllowGuildReCall", M2Share.g_GameCommand.ALLOWGUILDRECALL);
            M2Share.g_GameCommand.GUILDRECALLL = GetConfig("GuildReCall", M2Share.g_GameCommand.GUILDRECALLL);
            M2Share.g_GameCommand.UNLOCKSTORAGE = GetConfig("StorageUnLock", M2Share.g_GameCommand.UNLOCKSTORAGE);
            M2Share.g_GameCommand.UnLock = GetConfig("PasswordUnLock", M2Share.g_GameCommand.UnLock);
            M2Share.g_GameCommand.__Lock = GetConfig("StorageLock", M2Share.g_GameCommand.__Lock);
            M2Share.g_GameCommand.SETPASSWORD = GetConfig("StorageSetPassword", M2Share.g_GameCommand.SETPASSWORD);
            M2Share.g_GameCommand.PASSWORDLOCK = GetConfig("PasswordLock", M2Share.g_GameCommand.PASSWORDLOCK);
            M2Share.g_GameCommand.CHGPASSWORD = GetConfig("StorageChgPassword", M2Share.g_GameCommand.CHGPASSWORD);
            M2Share.g_GameCommand.CLRPASSWORD = GetConfig("StorageClearPassword", M2Share.g_GameCommand.CLRPASSWORD);
            M2Share.g_GameCommand.UNPASSWORD = GetConfig("StorageUserClearPassword", M2Share.g_GameCommand.UNPASSWORD);
            M2Share.g_GameCommand.MEMBERFUNCTION = GetConfig("MemberFunc", M2Share.g_GameCommand.MEMBERFUNCTION);
            M2Share.g_GameCommand.MEMBERFUNCTIONEX = GetConfig("MemberFuncEx", M2Share.g_GameCommand.MEMBERFUNCTIONEX);
            M2Share.g_GameCommand.DEAR = GetConfig("Dear", M2Share.g_GameCommand.DEAR);
            M2Share.g_GameCommand.MASTER = GetConfig("Master", M2Share.g_GameCommand.MASTER);
            M2Share.g_GameCommand.DEARRECALL = GetConfig("DearRecall", M2Share.g_GameCommand.DEARRECALL);
            M2Share.g_GameCommand.MASTERECALL = GetConfig("MasterRecall", M2Share.g_GameCommand.MASTERECALL);
            M2Share.g_GameCommand.ALLOWDEARRCALL = GetConfig("AllowDearRecall", M2Share.g_GameCommand.ALLOWDEARRCALL);
            M2Share.g_GameCommand.ALLOWMASTERRECALL = GetConfig("AllowMasterRecall", M2Share.g_GameCommand.ALLOWMASTERRECALL);
            M2Share.g_GameCommand.ATTACKMODE = GetConfig("AttackMode", M2Share.g_GameCommand.ATTACKMODE);
            M2Share.g_GameCommand.REST = GetConfig("Rest", M2Share.g_GameCommand.REST);
            M2Share.g_GameCommand.TAKEONHORSE = GetConfig("TakeOnHorse", M2Share.g_GameCommand.TAKEONHORSE);
            M2Share.g_GameCommand.TAKEOFHORSE = GetConfig("TakeOffHorse", M2Share.g_GameCommand.TAKEOFHORSE);
            M2Share.g_GameCommand.HUMANLOCAL = GetConfig("HumanLocal", M2Share.g_GameCommand.HUMANLOCAL);
            M2Share.g_GameCommand.Move = GetConfig("Move", M2Share.g_GameCommand.Move);
            M2Share.g_GameCommand.Move = GetConfig("PositionMove", M2Share.g_GameCommand.Move);
            M2Share.g_GameCommand.INFO = GetConfig("Info", M2Share.g_GameCommand.INFO);
            M2Share.g_GameCommand.MOBLEVEL = GetConfig("MobLevel", M2Share.g_GameCommand.MOBLEVEL);
            M2Share.g_GameCommand.MOBCOUNT = GetConfig("MobCount", M2Share.g_GameCommand.MOBCOUNT);
            M2Share.g_GameCommand.HUMANCOUNT = GetConfig("HumanCount", M2Share.g_GameCommand.HUMANCOUNT);
            M2Share.g_GameCommand.Map = GetConfig("Map", M2Share.g_GameCommand.Map);
            M2Share.g_GameCommand.KICK = GetConfig("Kick", M2Share.g_GameCommand.KICK);
            M2Share.g_GameCommand.TING = GetConfig("Ting", M2Share.g_GameCommand.TING);
            M2Share.g_GameCommand.SUPERTING = GetConfig("SuperTing", M2Share.g_GameCommand.SUPERTING);
            M2Share.g_GameCommand.MAPMOVE = GetConfig("MapMove", M2Share.g_GameCommand.MAPMOVE);
            M2Share.g_GameCommand.SHUTUP = GetConfig("Shutup", M2Share.g_GameCommand.SHUTUP);
            M2Share.g_GameCommand.RELEASESHUTUP = GetConfig("ReleaseShutup", M2Share.g_GameCommand.RELEASESHUTUP);
            M2Share.g_GameCommand.SHUTUPLIST = GetConfig("ShutupList", M2Share.g_GameCommand.SHUTUPLIST);
            M2Share.g_GameCommand.GAMEMASTER = GetConfig("GameMaster", M2Share.g_GameCommand.GAMEMASTER);
            M2Share.g_GameCommand.OBSERVER = GetConfig("ObServer", M2Share.g_GameCommand.OBSERVER);
            M2Share.g_GameCommand.SUEPRMAN = GetConfig("SuperMan", M2Share.g_GameCommand.SUEPRMAN);
            M2Share.g_GameCommand.Level = GetConfig("Level", M2Share.g_GameCommand.Level);
            M2Share.g_GameCommand.SABUKWALLGOLD = GetConfig("SabukWallGold", M2Share.g_GameCommand.SABUKWALLGOLD);
            M2Share.g_GameCommand.RECALL = GetConfig("Recall", M2Share.g_GameCommand.RECALL);
            M2Share.g_GameCommand.REGOTO = GetConfig("ReGoto", M2Share.g_GameCommand.REGOTO);
            M2Share.g_GameCommand.SHOWFLAG = GetConfig("Flag", M2Share.g_GameCommand.SHOWFLAG);
            M2Share.g_GameCommand.MOB = GetConfig("Mob", M2Share.g_GameCommand.MOB);
            M2Share.g_GameCommand.MOBNPC = GetConfig("MobNpc", M2Share.g_GameCommand.MOBNPC);
            M2Share.g_GameCommand.DELNPC = GetConfig("DelNpc", M2Share.g_GameCommand.DELNPC);
            M2Share.g_GameCommand.NPCSCRIPT = GetConfig("NpcScript", M2Share.g_GameCommand.NPCSCRIPT);
            M2Share.g_GameCommand.RECALLMOB = GetConfig("RecallMob", M2Share.g_GameCommand.RECALLMOB);
            M2Share.g_GameCommand.RECALLMOBEX = GetConfig("RECALLMOBEX", M2Share.g_GameCommand.RECALLMOBEX);
            M2Share.g_GameCommand.GIVEMINE = GetConfig("GIVEMINE", M2Share.g_GameCommand.GIVEMINE);
            M2Share.g_GameCommand.MOVEMOBTO = GetConfig("MOVEMOBTO", M2Share.g_GameCommand.MOVEMOBTO);
            M2Share.g_GameCommand.CLEARITEMMAP = GetConfig("CLEARITEMMAP", M2Share.g_GameCommand.CLEARITEMMAP);
            M2Share.g_GameCommand.LUCKYPOINT = GetConfig("LuckPoint", M2Share.g_GameCommand.LUCKYPOINT);
            M2Share.g_GameCommand.LOTTERYTICKET = GetConfig("LotteryTicket", M2Share.g_GameCommand.LOTTERYTICKET);
            M2Share.g_GameCommand.RELOADGUILD = GetConfig("ReloadGuild", M2Share.g_GameCommand.RELOADGUILD);
            M2Share.g_GameCommand.RELOADLINENOTICE = GetConfig("ReloadLineNotice", M2Share.g_GameCommand.RELOADLINENOTICE);
            M2Share.g_GameCommand.RELOADABUSE = GetConfig("ReloadAbuse", M2Share.g_GameCommand.RELOADABUSE);
            M2Share.g_GameCommand.BACKSTEP = GetConfig("BackStep", M2Share.g_GameCommand.BACKSTEP);
            M2Share.g_GameCommand.FREEPENALTY = GetConfig("FreePenalty", M2Share.g_GameCommand.FREEPENALTY);
            M2Share.g_GameCommand.PKPOINT = GetConfig("PkPoint", M2Share.g_GameCommand.PKPOINT);
            M2Share.g_GameCommand.IncPkPoint = GetConfig("IncPkPoint", M2Share.g_GameCommand.IncPkPoint);
            M2Share.g_GameCommand.HUNGER = GetConfig("Hunger", M2Share.g_GameCommand.HUNGER);
            M2Share.g_GameCommand.HAIR = GetConfig("Hair", M2Share.g_GameCommand.HAIR);
            M2Share.g_GameCommand.TRAINING = GetConfig("Training", M2Share.g_GameCommand.TRAINING);
            M2Share.g_GameCommand.DELETESKILL = GetConfig("DeleteSkill", M2Share.g_GameCommand.DELETESKILL);
            M2Share.g_GameCommand.CHANGEJOB = GetConfig("ChangeJob", M2Share.g_GameCommand.CHANGEJOB);
            M2Share.g_GameCommand.CHANGEGENDER = GetConfig("ChangeGender", M2Share.g_GameCommand.CHANGEGENDER);
            M2Share.g_GameCommand.Mission = GetConfig("Mission", M2Share.g_GameCommand.Mission);
            M2Share.g_GameCommand.MobPlace = GetConfig("MobPlace", M2Share.g_GameCommand.MobPlace);
            M2Share.g_GameCommand.DELETEITEM = GetConfig("DeleteItem", M2Share.g_GameCommand.DELETEITEM);
            M2Share.g_GameCommand.CLEARMISSION = GetConfig("ClearMission", M2Share.g_GameCommand.CLEARMISSION);
            M2Share.g_GameCommand.SETFLAG = GetConfig("SetFlag", M2Share.g_GameCommand.SETFLAG);
            M2Share.g_GameCommand.RECONNECTION = GetConfig("ReConnection", M2Share.g_GameCommand.RECONNECTION);
            M2Share.g_GameCommand.DISABLEFILTER = GetConfig("DisableFilter", M2Share.g_GameCommand.DISABLEFILTER);
            M2Share.g_GameCommand.CHGUSERFULL = GetConfig("ChangeUserFull", M2Share.g_GameCommand.CHGUSERFULL);
            M2Share.g_GameCommand.CHGZENFASTSTEP = GetConfig("ChangeZenFastStep", M2Share.g_GameCommand.CHGZENFASTSTEP);
            M2Share.g_GameCommand.CONTESTPOINT = GetConfig("ContestPoint", M2Share.g_GameCommand.CONTESTPOINT);
            M2Share.g_GameCommand.STARTCONTEST = GetConfig("StartContest", M2Share.g_GameCommand.STARTCONTEST);
            M2Share.g_GameCommand.ENDCONTEST = GetConfig("EndContest", M2Share.g_GameCommand.ENDCONTEST);
            M2Share.g_GameCommand.ANNOUNCEMENT = GetConfig("Announcement", M2Share.g_GameCommand.ANNOUNCEMENT);
            M2Share.g_GameCommand.CHANGEITEMNAME = GetConfig("ChangeItemName", M2Share.g_GameCommand.CHANGEITEMNAME);
            M2Share.g_GameCommand.DISABLESENDMSG = GetConfig("DisableSendMsg", M2Share.g_GameCommand.DISABLESENDMSG);
            M2Share.g_GameCommand.ENABLESENDMSG = GetConfig("EnableSendMsg", M2Share.g_GameCommand.ENABLESENDMSG);
            M2Share.g_GameCommand.DISABLESENDMSGLIST = GetConfig("DisableSendMsgList", M2Share.g_GameCommand.DISABLESENDMSGLIST);
            M2Share.g_GameCommand.KILL = GetConfig("Kill", M2Share.g_GameCommand.KILL);
            M2Share.g_GameCommand.MAKE = GetConfig("Make", M2Share.g_GameCommand.MAKE);
            M2Share.g_GameCommand.SMAKE = GetConfig("SuperMake", M2Share.g_GameCommand.SMAKE);
            M2Share.g_GameCommand.BonusPoint = GetConfig("BonusPoint", M2Share.g_GameCommand.BonusPoint);
            M2Share.g_GameCommand.DELBONUSPOINT = GetConfig("DelBonuPoint", M2Share.g_GameCommand.DELBONUSPOINT);
            M2Share.g_GameCommand.RESTBONUSPOINT = GetConfig("RestBonuPoint", M2Share.g_GameCommand.RESTBONUSPOINT);
            M2Share.g_GameCommand.FIREBURN = GetConfig("FireBurn", M2Share.g_GameCommand.FIREBURN);
            M2Share.g_GameCommand.TESTSTATUS = GetConfig("TestStatus", M2Share.g_GameCommand.TESTSTATUS);
            M2Share.g_GameCommand.DELGOLD = GetConfig("DelGold", M2Share.g_GameCommand.DELGOLD);
            M2Share.g_GameCommand.ADDGOLD = GetConfig("AddGold", M2Share.g_GameCommand.ADDGOLD);
            M2Share.g_GameCommand.DELGAMEGOLD = GetConfig("DelGameGold", M2Share.g_GameCommand.DELGAMEGOLD);
            M2Share.g_GameCommand.ADDGAMEGOLD = GetConfig("AddGamePoint", M2Share.g_GameCommand.ADDGAMEGOLD);
            M2Share.g_GameCommand.GAMEGOLD = GetConfig("GameGold", M2Share.g_GameCommand.GAMEGOLD);
            M2Share.g_GameCommand.GAMEDIAMOND = GetConfig("GAMEDIAMOND", M2Share.g_GameCommand.GAMEDIAMOND);
            M2Share.g_GameCommand.GAMEGIRD = GetConfig("GAMEGIRD", M2Share.g_GameCommand.GAMEGIRD);
            M2Share.g_GameCommand.GAMEGLORY = GetConfig("GAMEGLORY", M2Share.g_GameCommand.GAMEGLORY);
            M2Share.g_GameCommand.HEROLOYAL = GetConfig("HEROLOYAL", M2Share.g_GameCommand.HEROLOYAL);
            M2Share.g_GameCommand.GAMEPOINT = GetConfig("GamePoint", M2Share.g_GameCommand.GAMEPOINT);
            M2Share.g_GameCommand.CREDITPOINT = GetConfig("CreditPoint", M2Share.g_GameCommand.CREDITPOINT);
            M2Share.g_GameCommand.REFINEWEAPON = GetConfig("RefineWeapon", M2Share.g_GameCommand.REFINEWEAPON);
            M2Share.g_GameCommand.RELOADADMIN = GetConfig("ReloadAdmin", M2Share.g_GameCommand.RELOADADMIN);
            M2Share.g_GameCommand.ReLoadNpc = GetConfig("ReloadNpc", M2Share.g_GameCommand.ReLoadNpc);
            M2Share.g_GameCommand.RELOADMANAGE = GetConfig("ReloadManage", M2Share.g_GameCommand.RELOADMANAGE);
            M2Share.g_GameCommand.RELOADROBOTMANAGE = GetConfig("ReloadRobotManage", M2Share.g_GameCommand.RELOADROBOTMANAGE);
            M2Share.g_GameCommand.RELOADROBOT = GetConfig("ReloadRobot", M2Share.g_GameCommand.RELOADROBOT);
            M2Share.g_GameCommand.RELOADMONITEMS = GetConfig("ReloadMonitems", M2Share.g_GameCommand.RELOADMONITEMS);
            M2Share.g_GameCommand.RELOADITEMDB = GetConfig("ReloadItemDB", M2Share.g_GameCommand.RELOADITEMDB);
            M2Share.g_GameCommand.RELOADMAGICDB = GetConfig("ReloadMagicDB", M2Share.g_GameCommand.RELOADMAGICDB);
            M2Share.g_GameCommand.RELOADMONSTERDB = GetConfig("ReloadMonsterDB", M2Share.g_GameCommand.RELOADMONSTERDB);
            M2Share.g_GameCommand.ReAlive = GetConfig("ReAlive", M2Share.g_GameCommand.ReAlive);
            M2Share.g_GameCommand.SysMsg = GetConfig("SysMsg", M2Share.g_GameCommand.SysMsg);
            M2Share.g_GameCommand.HEROLEVEL = GetConfig("HEROLEVEL", M2Share.g_GameCommand.HEROLEVEL);
            M2Share.g_GameCommand.ADJUESTLEVEL = GetConfig("AdjuestTLevel", M2Share.g_GameCommand.ADJUESTLEVEL);
            M2Share.g_GameCommand.NGLEVEL = GetConfig("NGLevel", M2Share.g_GameCommand.NGLEVEL);
            M2Share.g_GameCommand.ADJUESTEXP = GetConfig("AdjuestExp", M2Share.g_GameCommand.ADJUESTEXP);
            M2Share.g_GameCommand.AddGuild = GetConfig("AddGuild", M2Share.g_GameCommand.AddGuild);
            M2Share.g_GameCommand.DELGUILD = GetConfig("DelGuild", M2Share.g_GameCommand.DELGUILD);
            M2Share.g_GameCommand.CHANGESABUKLORD = GetConfig("ChangeSabukLord", M2Share.g_GameCommand.CHANGESABUKLORD);
            M2Share.g_GameCommand.FORCEDWALLCONQUESTWAR = GetConfig("ForcedWallConQuestWar", M2Share.g_GameCommand.FORCEDWALLCONQUESTWAR);
            M2Share.g_GameCommand.ADJUESTTESTLEVEL = GetConfig("AdjuestTestLevel", M2Share.g_GameCommand.ADJUESTTESTLEVEL);
            M2Share.g_GameCommand.TRAININGSKILL = GetConfig("OpTraining", M2Share.g_GameCommand.TRAININGSKILL);
            M2Share.g_GameCommand.WHO = GetConfig("Who", M2Share.g_GameCommand.WHO);
            M2Share.g_GameCommand.TOTAL = GetConfig("Total", M2Share.g_GameCommand.TOTAL);
            M2Share.g_GameCommand.MAPINFO = GetConfig("MapInfo", M2Share.g_GameCommand.MAPINFO);
            M2Share.g_GameCommand.CHANGEDEARNAME = GetConfig("ChangeDearName", M2Share.g_GameCommand.CHANGEDEARNAME);
            M2Share.g_GameCommand.CHANGEMASTERNAME = GetConfig("ChangeMasterName", M2Share.g_GameCommand.CHANGEMASTERNAME);
            M2Share.g_GameCommand.STARTQUEST = GetConfig("StartQuest", M2Share.g_GameCommand.STARTQUEST);
            M2Share.g_GameCommand.SETPERMISSION = GetConfig("SetPermission", M2Share.g_GameCommand.SETPERMISSION);
            M2Share.g_GameCommand.CLEARMON = GetConfig("ClearMon", M2Share.g_GameCommand.CLEARMON);
            M2Share.g_GameCommand.RENEWLEVEL = GetConfig("ReNewLevel", M2Share.g_GameCommand.RENEWLEVEL);
            M2Share.g_GameCommand.DENYIPLOGON = GetConfig("DenyIPaddrLogon", M2Share.g_GameCommand.DENYIPLOGON);
            M2Share.g_GameCommand.DENYACCOUNTLOGON = GetConfig("DenyAccountLogon", M2Share.g_GameCommand.DENYACCOUNTLOGON);
            M2Share.g_GameCommand.DENYCHARNAMELOGON = GetConfig("DenyCharNameLogon", M2Share.g_GameCommand.DENYCHARNAMELOGON);
            M2Share.g_GameCommand.DELDENYIPLOGON = GetConfig("DelDenyIPLogon", M2Share.g_GameCommand.DELDENYIPLOGON);
            M2Share.g_GameCommand.DELDENYACCOUNTLOGON = GetConfig("DelDenyAccountLogon", M2Share.g_GameCommand.DELDENYACCOUNTLOGON);
            M2Share.g_GameCommand.DELDENYCHARNAMELOGON = GetConfig("DelDenyCharNameLogon", M2Share.g_GameCommand.DELDENYCHARNAMELOGON);
            M2Share.g_GameCommand.SHOWDENYIPLOGON = GetConfig("ShowDenyIPLogon", M2Share.g_GameCommand.SHOWDENYIPLOGON);
            M2Share.g_GameCommand.SHOWDENYACCOUNTLOGON = GetConfig("ShowDenyAccountLogon", M2Share.g_GameCommand.SHOWDENYACCOUNTLOGON);
            M2Share.g_GameCommand.SHOWDENYCHARNAMELOGON = GetConfig("ShowDenyCharNameLogon", M2Share.g_GameCommand.SHOWDENYCHARNAMELOGON);
            M2Share.g_GameCommand.VIEWWHISPER = GetConfig("ViewWhisper", M2Share.g_GameCommand.VIEWWHISPER);
            M2Share.g_GameCommand.SPIRIT = GetConfig("SpiritStart", M2Share.g_GameCommand.SPIRIT);
            M2Share.g_GameCommand.SPIRITSTOP = GetConfig("SpiritStop", M2Share.g_GameCommand.SPIRITSTOP);
            M2Share.g_GameCommand.SetMapMode = GetConfig("SetMapMode", M2Share.g_GameCommand.SetMapMode);
            M2Share.g_GameCommand.SHOWMAPMODE = GetConfig("ShoweMapMode", M2Share.g_GameCommand.SHOWMAPMODE);
            M2Share.g_GameCommand.CLEARBAG = GetConfig("ClearBag", M2Share.g_GameCommand.CLEARBAG);
            M2Share.g_GameCommand.REMTEMSG = GetConfig("RemoteMsg", M2Share.g_GameCommand.REMTEMSG);
            M2Share.g_GameCommand.COLORSAY = GetConfig("ColorSay", M2Share.g_GameCommand.COLORSAY);
            M2Share.g_GameCommand.SETCOLORSAY = GetConfig("SETCOLORSAY", M2Share.g_GameCommand.SETCOLORSAY);
            M2Share.g_GameCommand.AllowReAlive = GetConfig("AllowReAlive", M2Share.g_GameCommand.AllowReAlive);
            M2Share.g_GameCommand.UserItem = GetConfig("USERITEM", M2Share.g_GameCommand.UserItem);
            M2Share.g_GameCommand.SIGNMOVE = GetConfig("SIGNMOVE", M2Share.g_GameCommand.SIGNMOVE);
            M2Share.g_GameCommand.CLEARCOPYITEM = GetConfig("CLEARCOPYITEM", M2Share.g_GameCommand.CLEARCOPYITEM);
            M2Share.g_GameCommand.SHOWEFFECT = GetConfig("SHOWEFFECT", M2Share.g_GameCommand.SHOWEFFECT);
            M2Share.g_GameCommand.LOCKLOGON = GetConfig("LockLogin", M2Share.g_GameCommand.LOCKLOGON);
            //M2Share.g_GMRedMsgCmd = GetConfig("GMRedMsgCmd", M2Share.g_GMRedMsgCmd);
        }

        private TGameCmd GetConfig(string commandName, TGameCmd gameCmd)
        {
            if (!_tableConfig.ContainsKey(commandName))
            {
                M2Share.MainOutMessage("游戏命令配置错误.");
                return null;
            }
            var commandData = _tableConfig.Get<Dictionary<string, object>>(commandName);
            object cmdName = string.Empty;
            object minPermission = 0;
            object maxPermission = 0;
            if (commandData.TryGetValue("CommandName", out cmdName))
            {
                gameCmd.sCmd = cmdName.ToString();
            }
            if (commandData.TryGetValue("MinPermission", out minPermission))
            {
                gameCmd.nPermissionMin = System.Convert.ToInt32(minPermission);
            }
            if (commandData.TryGetValue("MaxPermission", out maxPermission))
            {
                gameCmd.nPermissionMax = System.Convert.ToInt32(minPermission);
            }
            return gameCmd;
        }
    }
}
